#region Copyright RenGuiYou. All rights reserved.
//=====================================================
// PandoraFrameWork
// Author:      RenGuiyou
// Feedback: 	mailto:750539605@qq.com
//=====================================================
#endregion

namespace PandoraEditor
{
	public static class BuildSetting
	{

	    private static ProjectBuildSetting m_ProjectBuildSetting;
	    private static AssetsBuildSetting m_AssetsBuildSetting;
	    private static LocalServerSetting m_LocalServerSetting;

	    public static ProjectBuildSetting ProjectBuildSetting => m_ProjectBuildSetting ??= SettingHelper.LoadSettings<ProjectBuildSetting>();
	    public static AssetsBuildSetting AssetsBuildSetting => m_AssetsBuildSetting ??= SettingHelper.LoadSettings<AssetsBuildSetting>();
	    public static LocalServerSetting LocalServerSetting => m_LocalServerSetting ??= SettingHelper.LoadSettings<LocalServerSetting>();

	    public static void Clear()
		{
			m_ProjectBuildSetting = null;
			m_AssetsBuildSetting = null;
			m_LocalServerSetting = null;
		}

		public static void SaveAll()
		{
			SettingHelper.SaveSingleSetting(ProjectBuildSetting);
			SettingHelper.SaveSingleSetting(AssetsBuildSetting);
			SettingHelper.SaveSingleSetting(LocalServerSetting);
		}
	}
}